/**
 * 
 */
package uit.comstore.model.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author XIII
 *
 */
@Entity
@Table(name="Products")
@SuppressWarnings("serial")
public class Product implements Serializable {

	private Long id;
	private String name;
	private String description;
	private String image;
	private Integer quantity;
	private BigDecimal price;
	private Date dateAdded;
	private Date lastModified;
	private Integer status;
	private Integer deleted;
	
	private ProductUnit unit;
	private Manufacturer manufacturer;
	private Category category;
	
	@Id
	@GeneratedValue
	@Column(name="ProductsId")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name="ProductsName")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name="ProductsDescription")
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	@Column(name="ProductsImage")
	public String getImage() {
		return image;
	}
	public void setImage(String image) {
		this.image = image;
	}
	@Column(name="ProductsQuantity")
	public Integer getQuantity() {
		return quantity;
	}
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}
	
	@Column(name="ProductsPrice")
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	
	@Column(name="ProductsDateAdded")
	public Date getDateAdded() {
		return dateAdded;
	}
	public void setDateAdded(Date dateAdded) {
		this.dateAdded = dateAdded;
	}
	
	@Column(name="ProductsLastModified")
	public Date getLastModified() {
		return lastModified;
	}
	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}
	
	@Column(name="ProductsStatus")
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@Column(name="IsDeleted")
	public Integer getDeleted() {
		return deleted;
	}
	public void setDeleted(Integer deleted) {
		this.deleted = deleted;
	}
	
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="ProductsUnitClassId", referencedColumnName="ProductsUnitClassId")
	public ProductUnit getUnit() {
		return unit;
	}
	public void setUnit(ProductUnit unit) {
		this.unit = unit;
	}
	
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="ManufacturesId", referencedColumnName="ManufacturersId")
	public Manufacturer getManufacturer() {
		return manufacturer;
	}
	public void setManufacturer(Manufacturer manufacturer) {
		this.manufacturer = manufacturer;
	}
	
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="CategoriesId", referencedColumnName="CategoriesId")
	public Category getCategory() {
		return category;
	}
	public void setCategory(Category category) {
		this.category = category;
	}
}

